package com.aeye.mbr.upms.dao.model;

import com.aeye.mbr.model.constant.UpmsDatabaseConstants;
import com.gitee.sunchenbin.mybatis.actable.annotation.DBColumn;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

@Table(name = UpmsDatabaseConstants.TABLE_UPMS_ORGANIZATION)
public class UpmsOrganization implements Serializable {
    /**
     * 编号
     *
     * @mbg.generated
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY,generator = "AESEQ_AB31")
    @DBColumn(type = MySqlTypeConstant.INT,length = 10,isKey = true)
    private Integer organizationId;

    /**
     * 所属上级
     *
     * @mbg.generated
     */
    @DBColumn(type = MySqlTypeConstant.INT,length = 10)
    private Integer pid;

    /**
     * 组织名称
     *
     * @mbg.generated
     */
    @DBColumn(type = MySqlTypeConstant.VARCHAR,length = 20)
    private String name;

    @DBColumn(type = MySqlTypeConstant.VARCHAR,length = 20)
    private String areaCode;

    @DBColumn(type = MySqlTypeConstant.VARCHAR,length = 20)
    private String type;

    @DBColumn(type = MySqlTypeConstant.VARCHAR,length = 20)
    private String longitude;

    @DBColumn(type = MySqlTypeConstant.VARCHAR,length = 20)
    private String latitude;

    @DBColumn(type = MySqlTypeConstant.VARCHAR,length = 20)
    private String contactName;

    @DBColumn(type = MySqlTypeConstant.VARCHAR,length = 20)
    private String contactPhone;

    @DBColumn(type = MySqlTypeConstant.VARCHAR,length = 20)
    private String originalId;

    @DBColumn(type = MySqlTypeConstant.VARCHAR,length = 64)
    private String path;

    private static final long serialVersionUID = 1L;

    public Integer getOrganizationId() {
        return organizationId;
    }

    public void setOrganizationId(Integer organizationId) {
        this.organizationId = organizationId;
    }

    public Integer getPid() {
        return pid;
    }

    public void setPid(Integer pid) {
        this.pid = pid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAreaCode() {
        return areaCode;
    }

    public void setAreaCode(String areaCode) {
        this.areaCode = areaCode;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getLongitude() {
        return longitude;
    }

    public void setLongitude(String longitude) {
        this.longitude = longitude;
    }

    public String getLatitude() {
        return latitude;
    }

    public void setLatitude(String latitude) {
        this.latitude = latitude;
    }

    public String getContactName() {
        return contactName;
    }

    public void setContactName(String contactName) {
        this.contactName = contactName;
    }

    public String getContactPhone() {
        return contactPhone;
    }

    public void setContactPhone(String contactPhone) {
        this.contactPhone = contactPhone;
    }

    public String getOriginalId() {
        return originalId;
    }

    public void setOriginalId(String originalId) {
        this.originalId = originalId;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        UpmsOrganization that = (UpmsOrganization) o;

        if (organizationId != null ? !organizationId.equals(that.organizationId) : that.organizationId != null)
            return false;
        if (pid != null ? !pid.equals(that.pid) : that.pid != null) return false;
        if (name != null ? !name.equals(that.name) : that.name != null) return false;
        if (areaCode != null ? !areaCode.equals(that.areaCode) : that.areaCode != null) return false;
        if (type != null ? !type.equals(that.type) : that.type != null) return false;
        if (longitude != null ? !longitude.equals(that.longitude) : that.longitude != null) return false;
        if (latitude != null ? !latitude.equals(that.latitude) : that.latitude != null) return false;
        if (contactName != null ? !contactName.equals(that.contactName) : that.contactName != null) return false;
        if (contactPhone != null ? !contactPhone.equals(that.contactPhone) : that.contactPhone != null) return false;
        if (originalId != null ? !originalId.equals(that.originalId) : that.originalId != null) return false;
        return path != null ? path.equals(that.path) : that.path == null;
    }

    @Override
    public int hashCode() {
        int result = organizationId != null ? organizationId.hashCode() : 0;
        result = 31 * result + (pid != null ? pid.hashCode() : 0);
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (areaCode != null ? areaCode.hashCode() : 0);
        result = 31 * result + (type != null ? type.hashCode() : 0);
        result = 31 * result + (longitude != null ? longitude.hashCode() : 0);
        result = 31 * result + (latitude != null ? latitude.hashCode() : 0);
        result = 31 * result + (contactName != null ? contactName.hashCode() : 0);
        result = 31 * result + (contactPhone != null ? contactPhone.hashCode() : 0);
        result = 31 * result + (originalId != null ? originalId.hashCode() : 0);
        result = 31 * result + (path != null ? path.hashCode() : 0);
        return result;
    }
}